Chapter 2. How to clone a Laravel repository

How to clone correctly a obsidian repository

Clone

git clone <https://github.com/user/repositorio.git>
Note

Insetad of https://github.com/user/repositorio.git, you have to put your repository link

Go to the repository

cd repository

Install Composer dependencies

If you don't have composer, download and install it

Then execute:

composer install

This command will install all Laravel Dependencies


Config file

Laravel uses a configuration file (.env), when you create your laravel project this does not exist, to create and prepare you have to copy from .env.example:

cp .env.example .env

Then, generate key

Laravel requires a unique key to save all sensitive data:

php artisan key:generate

Configurate Database

Edit .env and set your DB values

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=name_of_your_db
DB_USERNAME=user
DB_PASSWORD=password

If you are using XAMPP, check if it is running


Migrate Database

If you are using migrations or database, you have to migrate all tables and fields with

php artisan migrate

If you need test data:

php artisan db:seed

Change permissions

Laravel needs permission to access to storage and bootstarp/cache:

chmod -R 775 storage bootstrap/cache

If you have other any trouble, try:

sudo chown -R www-data:www-data storage bootstrap/cache

Start Laravel server

To try app, you can run:

php artisan serve

By default, the application will run on: http://127.0.0.1:8000


Install Node

If your project is using Tailwindcss, Vue or React:

npm install

And compile Assets

npm run dev

(O npm run build para producciΓ³n)


If you do not have Tailwindcss

npm install tailwindcss @tailwindcss/vite